package com.example.demo.mapper;

import com.example.demo.pojo.Feedbackchuandi;
import com.example.demo.pojo.Swiperdata;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author yanglup
 * @create 2020-12-04 21:44
 */
@Mapper
public interface SwiperandfeedbackMapper {
    /**查询轮播图*/
    @Select("select * from swiperdata")
    List<Swiperdata> swiperdataback();

    /**添加轮播图*/
    @Insert("insert into swiperdata(image_src,navigator_url) values (#{image_src},#{navigator_url});")
    void Swiperaddbacktijiao(String image_src, String navigator_url);

    /**修改轮播图时查询*/
    @Select("select * from swiperdata where swiperdata_id=#{swiperdata_id};")
    Swiperdata Swiperupdate(Integer swiperdata_id);
    /**轮播图修改*/
    @Update("update swiperdata set swiperdata_id=#{swiperdata_id2},image_src=#{image_src},navigator_url=#{navigator_url} where swiperdata_id=#{swiperdata_id1}")
    void Swiperupdatetijiao(Integer swiperdata_id1, Integer swiperdata_id2, String image_src, String navigator_url);

    /**删除轮播图*/
    @Delete("delete from swiperdata where swiperdata_id=#{swiperdata_id};")
    void Swiperdelete(Integer swiperdata_id);

    /**算出总的条数*/
    @Select("select count(*) from swiperdata;")
    Integer Swiperallnumber();

    /**查询轮播图通过id*/
    @Select("select * from swiperdata where swiperdata_id like CONCAT('%',#{swiperdata_id},'%');")
    List<Swiperdata> Swiperqueryid(Integer swiperdata_id);

    /**查询的轮播图数量*/
    @Select("select count(*) from swiperdata where swiperdata_id like CONCAT('%',#{swiperdata_id},'%');")
    Integer Swiperqueryidnumber(Integer swiperdata_id);

    /****************************************************反馈处理*********************************************************************************/
    /**查看反馈列表*/
    @Select("select * from feedbacktable")
    List<Feedbackchuandi> wxfeedbacklist();
    /**列表数量*/
    @Select("select count(*) from feedbacktable")
    Integer wxfeedbacklistnumber();

    /**查看反馈页面*/
    @Select("select * from feedbacktable where feedback_id=#{feedback_id}")
    Feedbackchuandi WXFeedbackcheck(Integer feedback_id);

    /**删除反馈信息*/
    @Delete("delete from feedbacktable where feedback_id=#{feedback_id};")
    void WXFeedbackdelete(Integer feedback_id);
}
